﻿namespace Sai.Core
{
	using System;

	/// <summary>
	/// Models a unique identifier used in report generation and reconciliation.
	/// </summary>
	public class Identifier
	{
		public Identifier()
		{
			this.Value = Guid.NewGuid().ToString();
		}

		public Identifier(string value)
		{
			this.Value = value;
		}
        

		public string Value { get; private set; }

		public static implicit operator string(Identifier ident)
		{
			return ident.Value;
		}

		public static implicit operator Identifier(string id)
		{
			return new Identifier(id);
		} 

		public override string ToString()
		{
			return this.Value;
		}

		public override int GetHashCode()
		{
			return this.Value.GetHashCode();
		}
	}
}
